/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package dll;

/**
 *
 * @author mweya
 */
public class Node<AnyType> {
    private AnyType data;
    private Node prev;
    private Node next;
    
    public Node() {
        this.data = null;
        this.next = null;
        this.prev = null;
    }
    
    public Node(AnyType data) {
        this.data = data;
        this.prev = null;
        this.next = null;
    }
    
    public Node(AnyType data, Node prev, Node next) {
        this.data = data;
        this.prev = prev;
        this.next = next;
    }
    
    public AnyType getData() {
        return this.data;
    }
    
    public Node getPrev() {
        return this.prev;
    }
    
    public Node getNext() {
        return this.next;
    }
    
    public void setNext(Node next) {
        this.next = next;
    }
    
    public void setPrev(Node prev) {
        this.prev = prev;
    }
    
    public void setData(AnyType data) {
        this.data = data;
    }
    
    @Override
    public String toString() {
        return "Node=(data="+data+", Previous_node="+prev+", Next_node="+next+")";
    }
}